[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Function getint - inputs an integer from the keyboard
Syntax char *getint(void);
Prototype in keyboard.h
Remarks getint inputs an integer from the keyboard. Only
digits, leading sign and backspace are valid input.
Input is terminated when the ENTER key is pressed.
the maximum length of input is 25.
Video output is via Borland's console i/o.
Return value returns a string of the format [sn] [ddd] where
[sn] = optional sign (+ or -)
[ddd] = optional digits
See also getdouble(), getreal()
Example #include <keyboard.h>
#include <stdio.h>
main()
{
char *c;
printf("Give me an integer: ");
c = getint();
printf("Your input is %s\n",c);
}
Program output Give me an integer: -1289
Your input is -1289
See Also:
getdouble()
getget()
getreal()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson